﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="BatchBuildRoom.aspx.cs"
    Inherits="ZLDC.Estate.TM.BatchBuildRoom" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>批量添加栋阁房号</title>
    <base target="_self" />
    <link href="../css/main.css" rel="stylesheet" type="text/css" />
    <link href="../js/jquery/style/jquery.hiAlerts.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <form id="form1" runat="server">
    <table width="600px" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
        <tr>
            <td width="10%" align="right" bgcolor="#F7F7F7">
                楼盘名称：
            </td>
            <td width="30%" bgcolor="#FFFFFF" style="padding-left: 10px;">
                <asp:Label ID="lbEstateName" runat="server" Text=""></asp:Label>
            </td>
        </tr>
        <tr>
            <td width="10%" align="right" bgcolor="#F7F7F7">
                期数：
            </td>
            <td width="30%" bgcolor="#FFFFFF" style="padding-left: 10px;">
                <asp:TextBox ID="Phases" runat="server" Style="width: 15%" class="textdocdown"></asp:TextBox>
                &nbsp;&nbsp;期数别名：<asp:TextBox ID="PhasesOtherName" runat="server" Style="width: 15%"
                    class="textdocdown"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td width="10%" align="right" bgcolor="#F7F7F7">
                栋阁：
            </td>
            <td width="40%" bgcolor="#FFFFFF" style="padding-left: 10px;">
                前缀<input id="iBuildNameFirst" name="iBuildNameFirst" type="text" value="" class="textdocdown" style="width: 10%"
                    runat="server" />
                &nbsp; 中间<asp:TextBox ID="buildName1" runat="server" Style="width: 8%" class="textdocdown"></asp:TextBox>
                ~<asp:TextBox ID="buildName2" runat="server" Style="width: 8%" class="textdocdown"></asp:TextBox>
                &nbsp; 后缀<input id="iBuildNameEnd" name="iBuildNameEnd" type="text" value="" class="textdocdown" style="width: 10%"
                    runat="server" />
                &nbsp; 单位：<asp:TextBox ID="buildUnit" runat="server" Style="width: 8%" class="textdocdown"></asp:TextBox>
                <br />
                <font color="red">如单栋：从"单"到"单"，单位为:"栋"</font>
            </td>
        </tr>
        <tr>
            <td width="10%" align="right" bgcolor="#F7F7F7">
                单元：
            </td>
            <td width="30%" bgcolor="#FFFFFF" style="padding-left: 10px;">
                从<asp:TextBox ID="dUnit1" runat="server" Style="width: 15%" class="textdocdown"></asp:TextBox>
                到<asp:TextBox ID="dUnit2" runat="server" Style="width: 15%" class="textdocdown"></asp:TextBox>
                单位：<asp:TextBox ID="dUnit3" runat="server" Style="width: 10%" class="textdocdown"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td width="10%" align="right" bgcolor="#F7F7F7">
                总层数：
            </td>
            <td width="30%" bgcolor="#FFFFFF" style="padding-left: 10px;">
                <asp:TextBox ID="FloorTotal" runat="server" CssClass="textdocdown"></asp:TextBox>
                <font color="red">*</font> &nbsp;类型：
                <asp:DropDownList ID="sType" runat="server">
                </asp:DropDownList>
                &nbsp;用途：
                <asp:DropDownList ID="sUsage" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td height='25' bgcolor='#F7F7F7' align="right">
                房号层数：
            </td>
            <td height='25' bgcolor='#FFFFFF' align="left" style="padding-left: 10px;">
                <asp:TextBox ID="rFloor1" Width="60px" CssClass='textstyle' runat="server"></asp:TextBox>到
                <asp:TextBox ID="rFloor2" Width="60px" CssClass='textstyle' runat="server"></asp:TextBox>层<font
                    color="red">顺序从小到大</font>
            </td>
        </tr>
        <tr>
            <td height='25' bgcolor='#F7F7F7' align="right">
                房号：
            </td>
            <td height='25' bgcolor='#FFFFFF' align="left" style="padding-left: 10px;">
                前缀<input id="iNameFirst" name="iNameFirst" type="text" value="" class="textdocdown"
                    style="width: 10%" runat="server" />&nbsp;&nbsp; 中间
                <asp:TextBox ID="roomNo1" Width="30px" runat="server" CssClass="textstyle"></asp:TextBox>~<asp:TextBox
                    CssClass="textstyle" Width="30px" ID="roomNo2" runat="server"></asp:TextBox>
                &nbsp;&nbsp;后缀<input id="iNameEnd" name="iNameEnd" type="text" value="" class="textdocdown"
                    style="width: 10%" runat="server" />
                <br />
                前缀是指房号前面共同部份,如:A01, A02, A03,A04 .前缀填A,中间第一格填01；第二格填04
                <br />
                后缀是指房号后面共同部份,如:118, 128, 128,148 .中间第一格填12；第二格填14;后缀填8
                <br />
                没有前面后面共同的前后缀格不填 .如：户型01, 02, 03,04第一格填01；第二格填04.前后缀不填
                <br />
                户型从A,B,C,D的第一格填A;第二格填D．前后缀不填
            </td>
        </tr>
    </table>
    <div style="width: 600px; padding-top: 15px; cursor: pointer; text-align: center;">
        <asp:Button ID="btnSave" runat="server" Text="保存" CssClass="button_bak2" OnClick="btnSave_Click"
            OnClientClick="return submitOK();" />
    </div>
    <br />
    <input id="hEID" runat="server" type="hidden" />
    </form>

    <script src="../js/jquery/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script src="../js/jquery/jquery.hiAlerts-min.js" type="text/javascript"></script>

    <script src="../js/LexunJS.js" type="text/javascript"></script>

    <script type="text/javascript">
        // 提交前验证
        var checkSubmitFlg = false; //重复提交
        function submitOK() {
            var reg = /^[A-Za-z]+$/; ///验证是否是字母

            var regstr = /[^\u4E00-\u9FA5]/;  //验证是否是中文  


            var name1 = document.getElementById("buildName1").value;
            var name2 = document.getElementById("buildName2").value;
            if (name1 == "" || name2 == "") {
                alert("栋阁不能为空！");
                document.getElementById("buildName1").focus();
                return false;
            }
            //                 else {
            //                if ((!LexunJS.isValidPositiveInteger(name1) && !reg.test(name1) && !regstr.test(name1)) || (!LexunJS.isValidPositiveInteger(name2) && !reg.test(name2) && !regstr.test(name2))) {
            //                        alert("栋阁名称只能为正整数,字母,中文！");
            //                        document.getElementById("buildName1").focus();
            //                        return false;
            //                    }
            //                }

            var dUnit1 = document.getElementById("dUnit1").value;
            var dUnit2 = document.getElementById("dUnit2").value;

            if (dUnit1 != "") {
                if ((!LexunJS.isValidPositiveInteger(dUnit1) && !reg.test(dUnit1)) || (!LexunJS.isValidPositiveInteger(dUnit2) && !reg.test(dUnit2))) {
                    alert("单元只能为正整数，字母！");
                    document.getElementById("dUnit1").focus();
                    return false;
                }
            }

            var floorTotal = document.getElementById("FloorTotal").value;
            if (floorTotal == "") {
                alert("总层数不能为空！");
                document.getElementById("FloorTotal").focus();
                return false;
            } else {
                if (!LexunJS.isValidPositiveInteger(floorTotal)) {
                    alert("总层数只能为正整数！");
                    document.getElementById("FloorTotal").focus();
                    return false;
                }
            }

            var rFloor1 = document.getElementById("rFloor1").value;
            var rFloor2 = document.getElementById("rFloor2").value;
            if (rFloor1 == "" || rFloor2 == "") {
                alert("房号楼层不能为空！");
                return false;
            } else {
                if (!LexunJS.isValidPositiveInteger(rFloor1) || !LexunJS.isValidPositiveInteger(rFloor2)) {
                    alert("层数只能为正整数！");
                    document.getElementById("rFloor1").focus();
                    return false;
                }
            }

            var roomNo1 = document.getElementById("roomNo1").value;
            var roomNo2 = document.getElementById("roomNo2").value;

            if (roomNo1 == "" || roomNo2 == "") {
                alert("房号不能为空！");
                return false;
            } else {
                if (!LexunJS.isValidPositiveInteger(roomNo1) && !reg.test(roomNo2)) {
                    alert("房号只能为正整数，或者字母！");
                    document.getElementById("roomNo1").focus();
                    return false;
                }
            }

            //提交信息
            if (!checkSubmitFlg) {

                // 第一次提交
                checkSubmitFlg = true;
                document.getElementById("btnSave").value = "正在提交....";

            } else {

                //重复提交
                alert("按一次就够了，请勿重复提交！请耐心等待！谢谢合作！");
                return false;
            }
        }
        
    </script>

</body>
</html>
